module.exports = async function (ctx, next) {
    try {
        await next()
    } catch (e) {
        console.log(e)
        if (e.json) {
            ctx.body = e.json
        } else {
            ctx.body = {
                code: 500,
                message: '内部异常'
            }
        }
    }
}